<?php
    $year = 2008;
    if(($year%4 ==0)&& ($year%100!=0) ||($year%400==0)){
      echo $year.'年是润年';
    }else {
      echo $year.'年不是闰年';
    }
 ?>
 <!DOCTYPE html>
 <html lang="en">
 <head>
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <title>Document</title>
 </head>
 <body>
 <?php
  if(!empty($_post)){
      $year=$_post['year'];
      if($year==''){
          echo "您还没有输入年份";
      }else{
            if(is_numeric($year)){
                $year+=0;
                if(is_int($year)){
                    if($year<1){
                        echo '年份必须正整数';
                    }else{
                        if($year%4==0 && $year%100!=0 || $year%400==0)
                            echo "{$year}是闰年";
                        else
                            echo "{$year}是平年";  
                    }
                }else{
                    echo '您输入的不是整数';
                }
            }else{
                echo '您输入的不是数字';
            }
        }
    }
    // $year = 2008;
    // if(($year%4 ==0)&& ($year%100!=0) ||($year%400==0)){
    //   echo $year.'年是润年';
    // }else {
    //   echo $year.'年不是闰年';
    // }
 ?>
 <form action="post">
     请输入年份:<input type="text" name="year"><br/>
     <input type="submit" name="button" value="判断闰年">
 </form>
 </body>
 </html>